/*
package com.ruiyi.subway.service;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;

*/
/**
 * cms管理
 *//*

@Service
public class CmsLocationService {

	@Autowired
	private CmsLocationMapper cmsLocationMapper;
	@Autowired
	private OrgService orgService;
	*/
/**
	 * 获取 CMS token 令牌
	 * @return
	 *//*

	public String getCmsToken(User user) throws Exception {
		OrgDto org = orgService.selectByPrimaryKey(user.getTenantId(), user.getOrgId());
		// TODO 暂时使用原片的cms 地址 xutie
		CmsLocationDto cms = org.getOrgUploadPolicy().getOriginal();

		CmsClient cmsClient = new CmsClient(cms.getIpAddr(),cms.getAccKey(), cms.getSecret());
		String cmsToken = cmsClient.genToken(20*60);
		System.out.println("cmsToken = " + cmsToken);
		if (StringUtils.isEmpty(cmsToken)){
			throw new VcsRestException("cmsToken获取失败");
		}

		return cmsToken;
	}

	*/
/**
	 * 添加或修改
	 * @param cmsLocation
	 * @return
	 *//*

	public CmsLocationDto save(String tenant, CmsLocationDto cmsLocation) {

		CmsLocationDo cmsLocationDo = cmsLocationMapper.selectByPrimaryKey(tenant,cmsLocation.getId());

		if (cmsLocationDo != null) {
			cmsLocationMapper.updateByPrimaryKey(cmsLocationDo.getInstance(cmsLocation,tenant));
		} else {
			cmsLocationMapper.insert(cmsLocationDo.getInstance(cmsLocation,tenant));
		}

		return cmsLocation;
	}


	*/
/**
	 * 全部查询信息
	 * @return
	 *//*

	public List<CmsLocationDto> selectByTenant(String tenantID) {

		List<CmsLocationDto> cmsLocations = new ArrayList<>();
		List<CmsLocationDo> cmsLocationDos = cmsLocationMapper.selectByTenant(tenantID);
		for (CmsLocationDo cmsLocationDoTmp : cmsLocationDos) {
			cmsLocations.add(CmsLocationDto.getInstance(cmsLocationDoTmp));
		}

		return cmsLocations;
	}

	*/
/**
	 * 查询信息
	 * @return
	 *//*

	public CmsLocationDto selectByPrimaryKey(String tenantID, String cmsLocationId) {

		CmsLocationDo cmsLocationDo = cmsLocationMapper.selectByPrimaryKey(tenantID, cmsLocationId);
		return CmsLocationDto.getInstance(cmsLocationDo);
	}

	*/
/**
	 * 删除
	 * @return
	 *//*

	public void deleteByIdAndTenant(String tenantID,String cmsId) {

		cmsLocationMapper.deleteByIdAndTenant(cmsId, tenantID);
		
	}

	*/
/**
	 * 通过 acck 查询cms
	 * @param acck
	 * @return
	 *//*

	public CmsLocationDo selectByAcck(String acck){
		return cmsLocationMapper.selectByAcck(acck);
	}

	*/
/**
	 * 查询信息cmsName
	 * @return
	 *//*

	public String selectCmsNameByAcck(String acck,String tenantId){
		CmsLocationDo CmsName = cmsLocationMapper.selectCmsNameByAcck(acck,tenantId);
		return CmsName.getName();
	}

}
*/
